﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl1.ascx.cs" Inherits="GUESTSMANAGEMENT.View.WebUserControl1" %>
<%@ Register assembly="Coolite.Ext.Web" namespace="Coolite.Ext.Web" tagprefix="ext" %>

<ext:DesktopWindow ID="winGrdGuestsList" runat="server" Collapsible="true" Icon="Group"  Title="Lista de Convidados" Width="1200" Height="600">
    <Body>
        <ext:Hidden ID="txt_idGuestsList" runat="server"></ext:Hidden>
        <ext:Store ID="listStore" runat="server" OnRefreshData="MyData_Refresh">
            <Reader>
                <ext:JsonReader ReaderID="CDLISTGUEST">
                    <Fields>
                        <ext:RecordField Name="CDLISTGUESTS" />
                        <ext:RecordField Name="NMGUESTS" />
                        <ext:RecordField Name="NMPHONE" />
                        <ext:RecordField Name="NMMAIL" />
                        <ext:RecordField Name="NMUSER" />
                        <ext:RecordField Name="NMEVENT" />
                        <ext:RecordField Name="DTEVENT" Type="Date" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
        
        
        <ext:Panel ID="Panel1" runat="server" Width="1190" Height="590">
            <Body>
                <ext:BorderLayout ID="BorderLayout1" runat="server">
                    <North>
                        <ext:FormPanel Width="1189" Height="70" ID="FormPanel2" runat="server" Title="Dados do Evento" BodyStyle="padding:5px;" ButtonAlign="Right">
                            <Body>
                                <ext:ColumnLayout runat="server">
                                <ext:LayoutColumn ColumnWidth=".3">
                                    <ext:Panel ID="panelll" runat="server">
                                        <Body>
                                            <ext:FormLayout ID="FormLayout2" runat="server">
                                                <ext:Anchor>
                                                    <ext:DateField ID="eventDate" FieldLabel="Data" runat="server" AllowBlank="false" Width="115" BlankText="Data é requerido!" />    
                                                </ext:Anchor>    
                                            </ext:FormLayout>
                                        </Body>
                                    </ext:Panel>
                                </ext:LayoutColumn>
                                <ext:LayoutColumn ColumnWidth=".7">
                                    <ext:Panel ID="panel2" runat="server">
                                        <Body>
                                            <ext:FormLayout ID="FormLayout3" runat="server">
                                                <ext:Anchor>
                                                    <ext:TextField Width="600" ID="userName" FieldLabel="Usuário" runat="server" MaxLength="255" />
                                                </ext:Anchor>
                                            </ext:FormLayout>
                                        </Body>
                                    </ext:Panel>
                                </ext:LayoutColumn>
                                </ext:ColumnLayout>
                            </Body>
                        </ext:FormPanel>
                    </North>
                    <Center>
                        <ext:GridPanel ID="GridPanel1" 
                            runat="server"
                            StoreID="listStore"
                            Width="1000"
                            Height="510"
                            StripeRows="true"
                            Enabled="true">
                            <ColumnModel ID="ColumnModel2" runat="server">
                                <Columns>
                                    <ext:Column ColumnID="NMGUESTS" Header="Nome" Width="200" DataIndex="NMGUESTS" Sortable="true" />
                                    <ext:Column ColumnID="NMPHONE" Header="Telefone" Width="100" DataIndex="NMPHONE" Sortable="true" />
                                    <ext:Column ColumnID="NMMAIL" Header="E-mail" Width="150" DataIndex="NMMAIL" Sortable="true" />
                                    <ext:Column ColumnID="NMUSER" Header="Promoter" Width="150" DataIndex="NMUSER" Sortable="true" />
                                    <ext:Column ColumnID="NMEVENT" Header="Nome Evento" Width="100" DataIndex="NMEVENT" Sortable="true" />
                                    <ext:Column ColumnID="DTEVENT" Header="Data Evento" Width="100" DataIndex="DTEVENT" Sortable="true" />
                                    <ext:Column ColumnID="CDLISTGUESTS" DataIndex="CDLISTGUESTS" Hidden="true" />
                                </Columns>
                            </ColumnModel>
                            <BottomBar>
                                <ext:PagingToolBar ID="PagingToolBar1" runat="server" PageSize="100" StoreID="listStore" />
                            </BottomBar>
                        </ext:GridPanel>
                    </Center>
                    <East>
                          <ext:FormPanel Width="200" Height="510" ID="FormPanel1" runat="server" Title="Form Panel" BodyStyle="padding:5px;" ButtonAlign="Right">
                            <Body>
                                <ext:FormLayout ID="FormLayout1" runat="server">
                                    
                                </ext:FormLayout>
                            </Body>
                            <Buttons>
                                <ext:Button ID="Button1" runat="server" Text="Save To Grid">
                                    <Listeners>
                                        <Click Handler="#{FormPanel1}.getForm().updateRecord(#{GridPanel1}.getSelectionModel().getSelected());" />
                                    </Listeners>
                                </ext:Button>
                                <ext:Button ID="Button2" runat="server" Text="Reset Fields">
                                    <Listeners>
                                        <Click Handler="#{FormPanel1}.getForm().reset();" />
                                    </Listeners>
                                </ext:Button>
                                <ext:Button ID="Button3" runat="server" Text="Get Values...">
                                    <Menu>
                                        <ext:Menu ID="Menu1" runat="server">
                                            <Items>
                                                <ext:MenuItem ID="MenuItem1" runat="server" Text="Object" Checked="true">
                                                    <Listeners>
                                                        <Click Handler="alert(Ext.encode(#{FormPanel1}.getForm().getValues()));" />
                                                    </Listeners>
                                                </ext:MenuItem> 
                                                <ext:MenuItem ID="MenuItem2" runat="server" Text="String">
                                                    <Listeners>
                                                        <Click Handler="alert(#{FormPanel1}.getForm().getValues(true));" />
                                                    </Listeners>
                                                </ext:MenuItem>
                                            </Items>
                                        </ext:Menu>
                                    </Menu>                                    
                                </ext:Button>
                            </Buttons>
                        </ext:FormPanel>
                    </East>
                </ext:BorderLayout>
            </Body>
        </ext:Panel>
    </Body>
</ext:DesktopWindow>